GS_SS = {}
GS_SS.__index = GS_SS

local Name = "GameState_SelectionScreen"
local ScreenX = 900
local ScreenY = 600
local n_randomPlr = 6
local state_buton = 0
local frame_logo = 0

local static = 0
local touched = 1
local pressed = 2

function GS_SS.create( x,y , n )
	local self = {}
	setmetatable(self, GS_SS)
	self.ScreenX = x
	self.ScreenY = y
	self.n_randomPlr = n
	p_r = {}
	
	for i=1, self.n_randomPlr do
		p_r[i] = Player_r.create(x-64, y-64)

		table.insert(gameObjects["player_random"],p_r[i])

	end
	return self
end

function GS_SS:update( dt )

	frame_logo = frame_logo + dt *5
	if frame_logo > 23 then
		frame_logo = 0
	end


	for i,v in ipairs(gameObjects["player_random"]) do
		v:update(dt)
	end
	fisicasUpdate( dt )

	if love.mouse.getX() < 100 + 402 and love.mouse.getX() > 100 and love.mouse.getY() <  100 + 125 and love.mouse.getY() > 100 then
		state_buton = touched
	else
		state_buton = static
	end
end

function GS_SS:draw(  )


	love.graphics.draw(img.campo, quads.title, 0,0, 0, 1, 1)

	love.graphics.draw(img.logo_loco, quads.logo[math.floor(frame_logo % 23)], 0, 0, 0,4,4)

	for i,v in ipairs(gameObjects["player_random"]) do
		v:draw()
	end

	--[[
	for i=1,self.n_randomPlr do
		--p_r[i]:draw()
	end
	
	if state_buton == static then
		love.graphics.draw(img.boton_statico,100, 100)
	end
	if state_buton == touched then
		love.graphics.draw(img.boton_tocado,100, 100)
	end
	if state_buton == pressed then
		love.graphics.draw(img.boton_presionado,100, 100)
	end
	]]
	--love.graphics.draw(img.redcanasta, quads.title, 0,0, 0, 1, 1)
end